<?php
namespace app\miniprogram\controller;

class User extends Base {
    protected $process = ['UserInfo', 'tyyh\\User'];

    public function current() {
        $this->success('', $this->get_login()->getCurrentUser());
    }

    //修改用户信息
    public function update() {
        $this->ajax_process(function($process, $user){
            return $process->update($user);
        });
    }

    //获取用户名
    public function username() {
        $this->ajax_process(function($process, $user){
            return $process->username();
        });
    }

    //设置用户名密码
    public function set_user_password() {
        $this->ajax_process(function($process, $user){
            return $process->set_user_password();
        });
    }

    //修改密码
    public function set_password() {
        $this->ajax_process(function($process, $user){
            return $process->set_password($user);
        });
    }
}
